package com.ysd.productcate.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.ysd.common.entity.Productcate;
import com.ysd.productcate.mapper.ProductCateMapper;
import com.ysd.productcate.service.ProductCateService;
@Service
@Transactional(readOnly = true)
public class ProductCateServiceImpl implements ProductCateService{
	@Autowired
	ProductCateMapper productcatemapper;
	@Override
	@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
	public List<Productcate> findCateAllBySelAndPage(int p_id, int page, int limit) {
		// TODO Auto-generated method stub
		return productcatemapper.findCateAllBySelAndPage(p_id, page, limit);
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
	public int findProductCateTotal(int p_id, int page, int limit) {
		// TODO Auto-generated method stub
		return productcatemapper.findProductCateTotal(p_id, page, limit);
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
	public int saveProductCate(Productcate productcate) {
		// TODO Auto-generated method stub
		return productcatemapper.saveProductCate(productcate);
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
	public int updateProductCate(Productcate productcate) {
		// TODO Auto-generated method stub
		return productcatemapper.updateProductCate(productcate);
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
	public int delProductCate(int id) {
		// TODO Auto-generated method stub
		return productcatemapper.delProductCate(id);
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
	public List<Productcate> findCateAllParent() {
		// TODO Auto-generated method stub
		return productcatemapper.findCateAllParent();
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
	public List<Productcate> findCateAll() {
		// TODO Auto-generated method stub
		return productcatemapper.findCateAll();
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
	public List<Productcate> findCateAllChild(int pid) {
		// TODO Auto-generated method stub
		return productcatemapper.findCateAllChild(pid);
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
	public List<Productcate> findCateAllChilds() {
		// TODO Auto-generated method stub
		return productcatemapper.findCateAllChilds();
	}

}
